package com.xiaoyu.izf.controller.api;

import com.xiaoyu.izf.model.AppPicInfo;
import com.xiaoyu.izf.model.VipInfo;
import com.xiaoyu.izf.model.exception.BusinessStatusEnum;
import com.xiaoyu.izf.model.page.FormResult;
import com.xiaoyu.izf.service.AppHomePageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 为app首页显示提供接口
 */
@RestController
@RequestMapping("/api/app_home_page")
public class AppHomePageController extends BaseApiController{
    @Autowired
    private AppHomePageService appHomePageService;

    @RequestMapping("/vip_info")
    public FormResult vipInfo(){
        List<VipInfo> vipInfos = appHomePageService.vipInfos();
        return new FormResult(BusinessStatusEnum.OK,vipInfos);
    }

    @RequestMapping("/banner")
    public FormResult banner(){
        List<AppPicInfo> banners = appHomePageService.banners();
        return new FormResult(BusinessStatusEnum.OK,banners);
    }
}
